package za.co.smartmi.service.exception;

import za.co.smartmi.server.model.Profile;
import za.co.smartmi.server.model.ServiceError;
import java.util.List;

public class ProfileException extends ServiceException {
    
    protected Profile profile;

    public Profile getProfile() {
        return profile;
    }
    
    public ProfileException(Throwable cause) {
        super(cause);
    }

    public ProfileException(String message, Throwable cause) {
        super(message, cause);
    }

    public ProfileException(String message) {
        super(message);
    }

    /**
     * Use for a normal create exception
     * @param profile
     * @param message 
     */    
    public ProfileException(final Profile profile, String message) {
        super(message);
        this.profile = profile;
    }

    /**
     * Use this if you have more than one error to report
     * @param profile
     * @param message
     * @param errors 
     */
    public ProfileException(final Profile profile, String message, List<ServiceError> errors ) {
        super(message);
        this.profile = profile;
        this.getErrors().addAll(errors);        
    }
    
    /**
     * Use this for one error, as alternative choice
     * @param profile
     * @param message
     * @param error 
     */
    public ProfileException(final Profile profile, String message, ServiceError error ) {
        super(message);
        this.profile = profile;
        this.error = error;        
    }    
    
    
    
    public ProfileException() {
    }
    
    
}
